<?php
session_start();
Require_once '../Lib/main.php';
if (!Controller_LoginController::isLogin()) {
	header('Location: login.php');
	exit;
}

$page = null;
if (isset($_REQUEST['p'])) {
	$page = $_REQUEST['p'];
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/admin.css">
<script type="text/javascript" src="js/jquery-1.10.2.js"></script>
<link rel="stylesheet" type="text/css" href="js/extjs4.2.1/resources/css/ext-all.css">
<script type="text/javascript" src="js/extjs4.2.1/ext-all.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<title>Quản trị</title>
</head>
<body>
<div class="main-container">
	<table border="1" class="main-table" style="height: 600px;">
		<tr class="admin-header">
			<td colspan="2">
				<?php require 'framepage/headeradmin.php';?>
			</td>
		</tr>
		<tr>
			<td class="admin-menu-td">
				<?php require_once 'framepage/leftmenu.php'; ?>
			</td>
			<td id="center-container">
				<?php
					//require_once 'content/content_list_category.php';

					if ($page !== null) {

						$page = 'content/' . $page;

						if (is_readable($page)) {
							require_once $page;
						} else {
							echo "Page not found";
						}
					}
				?>
			</td>
		</tr>
	</table>
</div>
</body>
</html>
